<template>
	<view class="page">
		<!-- <view class="user-form-uni-list ">
			<view class="user-form-uni-list-cell" v-for="(item, index) in list" :key="index">
				<view class="user-form-uni-list-cell-navigate" v-if="item.type == 'text'">
					{{ item.title }}:
					<input v-model="val[item.filed]" class="inputext" type="text" :name="item.filed" placeholder="请输入" />
				</view>
			</view>
		</view> -->
		<view class="user-form-uni-list ">
			<view class="user-form-uni-list-cell">
				<view class="user-form-uni-list-cell-navigate">
					昵称:
					<input v-model="val" class="inputext" type="text" placeholder="请输入" />
				</view>
			</view>
		</view>
		<button type="default" class="lastbut" @click="fromup">提交</button>
	</view>
</template>
<script>
export default {
	data() {
		return {
			list: [],
			val: '',
			title: '',
			url: ''
		};
	},
	onLoad(res) {
		let arr = JSON.parse(res.obj);
		this.list = arr.data;
		this.title = arr.title;
		this.url = arr.url;
		uni.setNavigationBarTitle({
			title: arr.title
		});
	},
	methods: {
		fromup: function() {
			this.fromup1(this.val);
		},
		async fromup1(dataup) {
			var _this=this;
			uni.request({
				url:this.url,
				method:"GET",
				data:{
					userid:uni.getStorageSync("userid"),
					name:dataup
				} ,
				header:this.$API.get_head(),
				success: (res) => {
					setTimeout(function() {
						uni.navigateBack({
							delta: 1
						});
					}, 1000);
				},
				fail: () => {
					uni.showToast({
						title:"加载失败",
						icon:'none'
					})
				 }
			})
		}
	}
};
</script>

<style>
/* 列表 */

.user-form-uni-list {
	background-color: #FFFFFF;
	position: relative;
	width: 100%;
	display: flex;
	flex-direction: column;
}.user-form-uni-list-cell {
	position: relative;
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
}
.user-form-uni-list-cell-navigate {
	padding: 22upx 30upx;
	line-height: 48upx;
	position: relative;
	display: flex;
	box-sizing: border-box;
	width: 100%;
	flex: 1;
	justify-content: space-between;
	align-items: center;
}

.user-form-uni-list-cell-navigate {
	padding-right: 36upx;
}
.user-form-uni-list-cell-hover {
	background-color: #eee;
}
.inputext {
	width: 80%;
	display: block;
	background: #fff;
	border-radius: 10upx;
	padding: 5upx 10upx;
	font-size: 26upx;
}
.lastbut {
	width: 80%;
	margin: 50upx auto;
	background: #067aee !important;
	color: #ffffff !important;
	line-height: 2.2;
	border-radius: 80upx;
}
</style>
